<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="nav.css"/>
  <title>导航栏动画</title>

</head>
<body>
  <nav class="active" id="nav">
    <!-- 导航项 -->
    <ul>
      <li><a href="#">Home</a></li>
      <li><a href="#">Works</a></li>
      <li><a href="#">About</a></li>
      <li><a href="#">Contact</a></li>
    </ul>
    <!-- 按钮 -->
    <button class="icon" id="toggle" onclick="btnClick()">
      <div class="line line1"></div>
      <div class="line line2"></div>
    </button>
  </nav>
  <script src="nav.js"></script>
</body>
</html>